package com.springBootStudy.annotation;

import com.springBootStudy.annotation.pojo.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ program: elasticSearch_springBoot_study
 * @ description:
 * @ author: Mr.Zhongsf
 * @ create: 2021-03-09 10:59
 **/
public class annotationTest {
    public static void main(String[] args) {
        //------------------------------------------------@component 测试------------------------------------
        System.out.println("------------------------------@component 测试------------------------------------");

        ApplicationContext springContext = new ClassPathXmlApplicationContext("mapper/annotation.xml");
        User user = springContext.getBean("user", User.class );
        System.out.println(user.name);

        //------------------------------------------------@Value 测试------------------------------------
        System.out.println("------------------------------@Value 测试------------------------------------");
        System.out.println(user.name2);
    }
}
